<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function checkAll(b){
				var l = document.getElementsByName("z");
				
				for(i in l){
					l[i].checked = b;
				}
			}
			function checkAll1(b){
				var k = document.getElementsByName("s");
				
				for(i in k){
					k[i].checked = b;
				}
			}

		</script>
	</head>
	<body>
		<table>
			<tr>
				<td>
					<input type="checkbox" name="z" onclick="checkAll(this.checked)"/>字母全选开关
					<input type="checkbox" name="z"/>a
					<input type="checkbox" name="z"/>b
					<input type="checkbox" name="z"/>c
					<input type="checkbox" name="z"/>d
					<input type="checkbox" name="z"/>e
					<input type="checkbox" name="z"/>f
					<input type="checkbox" name="z"/>g
				</td>
			</tr>
			<tr>
				<td>
					<input type="checkbox" name="num" onclick="checkAll1(this.checked)"/>数字全选开关
					<input type="checkbox" name="s"/>1
					<input type="checkbox" name="s"/>2
					<input type="checkbox" name="s"/>3
				</td>
			</tr>
			<tr>
				<td>
					<input type="button" value="选择所有的字母" onclick="checkAll(true)"/>
					<input type="button" value="清空选中的字母" onclick="checkAll(false)"/>
				</td>
			</tr>
			<tr>
				<td>
					<input type="button" value="选择所有的数字" onclick="checkAll1(true)" />
					<input type="button" value="清空选中的数字" onclick="checkAll1(false)"/>
				</td>
			</tr>
		</table>
	</body>
</html>
